package com.gdougms.tools;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;

@Component
public class MailSenderTool {

    @Autowired
    JavaMailSender javaMailSender;


    /**@Title
     * @Description 发送只有文本的文件，
     * @Param [to, subject, content] 发送至、主题、内容
     * @return void
     * @Author iceF
     * @Date 2021/6/20
    */
    public void sendSimpleMail(String to, String subject, String content){
        SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
        simpleMailMessage.setFrom("1416858705@qq.com");
        simpleMailMessage.setTo(to);
        simpleMailMessage.setSubject(subject);
        simpleMailMessage.setText(content);
        javaMailSender.send(simpleMailMessage);
    }
}
